package org.wannatrak.android.activity;

import android.app.Dialog;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import org.wannatrak.android.helper.UIHelper;
import org.wannatrak.android.intf.DialogAction;

/**
 * @Author: Maksim Tulupov maxtulupov@gmail.com
 * @Date: $Date: 2011-06-17 10:42:07 +0000 (Fri, 17 Jun 2011) $ 12:05 PM
 * @version: $Revision: 11 $
 * @id: $Id: DialogHandler.java 11 2011-06-17 10:42:07Z maxtulupov@gmail.com $
 */
public class DialogHandler extends Handler {

    private Dialog dialog;

    private Context context;

    public DialogHandler(Dialog dialog, Context context) {
        this.dialog = dialog;
        this.context = context;
    }

    @Override
    public void handleMessage(Message msg) {
        if (msg.what < 0) {
            UIHelper.createAlertDialog(context, (String)msg.obj, -1, true, (DialogAction[]) null).show();
        }
    }
}
